Dynomotion

Group: DynoMotion Message: 12390 From: nkwok Date: 10/13/2015
Subject: erroneous limit switch triggered

Hello,


I have a  XY table that came with Hall-Effect limit switches which are wired into KFLOP JP7 IO0 - IO3 each with its +5V and 1K resistors.  I also have setup the KFLOP Axis to watch the +/- limit switch with Low active, and "Disallowed drive into limit" option.  However, when I was jogging with Mach3 cursor key and it will be stopped randomly with "Dynomotions Status: X Axis Disabled" message on the Mach3 Status line.  Is there anyway to denounce the watching limit switches or other configuration to filter the input noises?


Here is my axis configurations:

main()

{

ch0->InputMode=NO_INPUT_MODE;

ch0->OutputMode=STEP_DIR_MODE;

ch0->Vel=40000;

ch0->Accel=400000;

ch0->Jerk=4e+006;

ch0->P=0;

ch0->I=0.01;

ch0->D=0;

ch0->FFAccel=0;

ch0->FFVel=0;

ch0->MaxI=200;

ch0->MaxErr=1e+006;

ch0->MaxOutput=200;

ch0->DeadBandGain=1;

ch0->DeadBandRange=0;

ch0->InputChan0=0;

ch0->InputChan1=0;

ch0->OutputChan0=0;

ch0->OutputChan1=0;

ch0->MasterAxis=-1;

ch0->LimitSwitchOptions=0x11f;

ch0->LimitSwitchNegBit=1;

ch0->LimitSwitchPosBit=0;

ch0->SoftLimitPos=1e+009;

ch0->SoftLimitNeg=-1e+009;

ch0->InputGain0=1;

ch0->InputGain1=1;

ch0->InputOffset0=0;

ch0->InputOffset1=0;

ch0->OutputGain=1;

ch0->OutputOffset=0;

ch0->SlaveGain=1;

ch0->BacklashMode=BACKLASH_OFF;

ch0->BacklashAmount=0;

ch0->BacklashRate=0;

ch0->invDistPerCycle=1;

ch0->Lead=0;

ch0->MaxFollowingError=1000000000;

ch0->StepperAmplitude=20;


ch0->iir[0].B0=1;

ch0->iir[0].B1=0;

ch0->iir[0].B2=0;

ch0->iir[0].A1=0;

ch0->iir[0].A2=0;


ch0->iir[1].B0=1;

ch0->iir[1].B1=0;

ch0->iir[1].B2=0;

ch0->iir[1].A1=0;

ch0->iir[1].A2=0;


ch0->iir[2].B0=0.000768788;

ch0->iir[2].B1=0.00153758;

ch0->iir[2].B2=0.000768788;

ch0->iir[2].A1=1.92076;

ch0->iir[2].A2=-0.923833;


ch1->InputMode=NO_INPUT_MODE;

ch1->OutputMode=STEP_DIR_MODE;

ch1->Vel=40000;

ch1->Accel=8000;

ch1->Jerk=4e+006;

ch1->P=0;

ch1->I=0.01;

ch1->D=0;

ch1->FFAccel=0;

ch1->FFVel=0;

ch1->MaxI=200;

ch1->MaxErr=1e+006;

ch1->MaxOutput=200;

ch1->DeadBandGain=1;

ch1->DeadBandRange=0;

ch1->InputChan0=1;

ch1->InputChan1=0;

ch1->OutputChan0=1;

ch1->OutputChan1=0;

ch1->MasterAxis=-1;

ch1->LimitSwitchOptions=0x11f;

ch1->LimitSwitchNegBit=3;

ch1->LimitSwitchPosBit=2;

ch1->SoftLimitPos=1e+009;

ch1->SoftLimitNeg=-1e+009;

ch1->InputGain0=1;

ch1->InputGain1=1;

ch1->InputOffset0=0;

ch1->InputOffset1=0;

ch1->OutputGain=1;

ch1->OutputOffset=0;

ch1->SlaveGain=1;

ch1->BacklashMode=BACKLASH_OFF;

ch1->BacklashAmount=0;

ch1->BacklashRate=0;

ch1->invDistPerCycle=1;

ch1->Lead=0;

ch1->MaxFollowingError=1000000000;

ch1->StepperAmplitude=20;


ch1->iir[0].B0=1;

ch1->iir[0].B1=0;

ch1->iir[0].B2=0;

ch1->iir[0].A1=0;

ch1->iir[0].A2=0;


ch1->iir[1].B0=1;

ch1->iir[1].B1=0;

ch1->iir[1].B2=0;

ch1->iir[1].A1=0;

ch1->iir[1].A2=0;


ch1->iir[2].B0=0.000769;

ch1->iir[2].B1=0.001538;

ch1->iir[2].B2=0.000769;

ch1->iir[2].A1=1.92081;

ch1->iir[2].A2=-0.923885;


EnableAxisDest(0,ch0->Dest);

EnableAxisDest(1,ch1->Dest);

//EnableAxisDest(0,0);

//EnableAxisDest(1,0);

DefineCoordSystem(0,1,-1,-1);



Regards,

Norman

Group: DynoMotion Message: 12394 From: TK Date: 10/14/2015
Subject: Re: erroneous limit switch triggered
Hi Norman,

KFLOP inputs are very fast and therefore susceptible to narrow noise glitches.  KFLOP doesn't have selectable digital filtering.  It is usually best to fix the source of the problem in hardware.  Otherwise you might reduce the frequency of the problem but not eliminate it entirely.  You might add a Filter Capacitor (such as a 0.1uf ceramic capacitor) from the KFLOP input pin to the KFLOP GND (in very close proximity to KFLOP). 

To filter the inputs in software you can do so with a User Program that samples the input, performs some filtering algorithm, and sets/clears a KFLOP Virtual I/O Bit (ie bits 48-63) based on the result.   Then configure the KFLOP Axis to monitor the Virtual Inputs rather than the real inputs.   The ExternalButtons.c example shows how multiple inputs can be monitored and debounced using a single non-blocking loop using a state driven approach.  See the Debounce() function, how its used, and the 3 global variables needed for every input to keep track of the states of the input.

HTH
Regards
TK

On 10/13/2015 8:36 PM, nkwok@... [DynoMotion] wrote:
 

Hello,


I have a  XY table that came with Hall-Effect limit switches which are wired into KFLOP JP7 IO0 - IO3 each with its +5V and 1K resistors.  I also have setup the KFLOP Axis to watch the +/- limit switch with Low active, and "Disallowed drive into limit" option.  However, when I was jogging with Mach3 cursor key and it will be stopped randomly with "Dynomotions Status: X Axis Disabled" message on the Mach3 Status line.  Is there anyway to denounce the watching limit switches or other configuration to filter the input noises?


Here is my axis configurations:

main()

{

ch0->InputMode=NO_INPUT_MODE;

ch0->OutputMode=STEP_DIR_MODE;

ch0->Vel=40000;

ch0->Accel=400000;

ch0->Jerk=4e+006;

ch0->P=0;

ch0->I=0.01;

ch0->D=0;

ch0->FFAccel=0;

ch0->FFVel=0;

ch0->MaxI=200;

ch0->MaxErr=1e+006;

ch0->MaxOutput=200;

ch0->DeadBandGain=1;

ch0->DeadBandRange=0;

ch0->InputChan0=0;

ch0->InputChan1=0;

ch0->OutputChan0=0;

ch0->OutputChan1=0;

ch0->MasterAxis=-1;

ch0->LimitSwitchOptions=0x11f;

ch0->LimitSwitchNegBit=1;

ch0->LimitSwitchPosBit=0;

ch0->SoftLimitPos=1e+009;

ch0->SoftLimitNeg=-1e+009;

ch0->InputGain0=1;

ch0->InputGain1=1;

ch0->InputOffset0=0;

ch0->InputOffset1=0;

ch0->OutputGain=1;

ch0->OutputOffset=0;

ch0->SlaveGain=1;

ch0->BacklashMode=BACKLASH_OFF;

ch0->BacklashAmount=0;

ch0->BacklashRate=0;

ch0->invDistPerCycle=1;

ch0->Lead=0;

ch0->MaxFollowingError=1000000000;

ch0->StepperAmplitude=20;


ch0->iir[0].B0=1;

ch0->iir[0].B1=0;

ch0->iir[0].B2=0;

ch0->iir[0].A1=0;

ch0->iir[0].A2=0;


ch0->iir[1].B0=1;

ch0->iir[1].B1=0;

ch0->iir[1].B2=0;

ch0->iir[1].A1=0;

ch0->iir[1].A2=0;


ch0->iir[2].B0=0.000768788;

ch0->iir[2].B1=0.00153758;

ch0->iir[2].B2=0.000768788;

ch0->iir[2].A1=1.92076;

ch0->iir[2].A2=-0.923833;


ch1->InputMode=NO_INPUT_MODE;

ch1->OutputMode=STEP_DIR_MODE;

ch1->Vel=40000;

ch1->Accel=8000;

ch1->Jerk=4e+006;

ch1->P=0;

ch1->I=0.01;

ch1->D=0;

ch1->FFAccel=0;

ch1->FFVel=0;

ch1->MaxI=200;

ch1->MaxErr=1e+006;

ch1->MaxOutput=200;

ch1->DeadBandGain=1;

ch1->DeadBandRange=0;

ch1->InputChan0=1;

ch1->InputChan1=0;

ch1->OutputChan0=1;

ch1->OutputChan1=0;

ch1->MasterAxis=-1;

ch1->LimitSwitchOptions=0x11f;

ch1->LimitSwitchNegBit=3;

ch1->LimitSwitchPosBit=2;

ch1->SoftLimitPos=1e+009;

ch1->SoftLimitNeg=-1e+009;

ch1->InputGain0=1;

ch1->InputGain1=1;

ch1->InputOffset0=0;

ch1->InputOffset1=0;

ch1->OutputGain=1;

ch1->OutputOffset=0;

ch1->SlaveGain=1;

ch1->BacklashMode=BACKLASH_OFF;

ch1->BacklashAmount=0;

ch1->BacklashRate=0;

ch1->invDistPerCycle=1;

ch1->Lead=0;

ch1->MaxFollowingError=1000000000;

ch1->StepperAmplitude=20;


ch1->iir[0].B0=1;

ch1->iir[0].B1=0;

ch1->iir[0].B2=0;

ch1->iir[0].A1=0;

ch1->iir[0].A2=0;


ch1->iir[1].B0=1;

ch1->iir[1].B1=0;

ch1->iir[1].B2=0;

ch1->iir[1].A1=0;

ch1->iir[1].A2=0;


ch1->iir[2].B0=0.000769;

ch1->iir[2].B1=0.001538;

ch1->iir[2].B2=0.000769;

ch1->iir[2].A1=1.92081;

ch1->iir[2].A2=-0.923885;


EnableAxisDest(0,ch0->Dest);

EnableAxisDest(1,ch1->Dest);

//EnableAxisDest(0,0);

//EnableAxisDest(1,0);

DefineCoordSystem(0,1,-1,-1);



Regards,

Norman


Group: DynoMotion Message: 12421 From: nkwok Date: 10/19/2015
Subject: Re: erroneous limit switch triggered
Tom,

We grounded the shied cables that came with the limit switches and the noise issue went away.  Thanks for all you suggestion!


Regards,
Norman
Group: DynoMotion Message: 12422 From: Tom Kerekes Date: 10/20/2015
Subject: Re: erroneous limit switch triggered
Hi Norman,

Great. You can thank us by adding a problem and resolution note on the wiki. 


Thanks
TK

On Oct 19, 2015, at 4:25 PM, nkwok@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Tom,


We grounded the shied cables that came with the limit switches and the noise issue went away.  Thanks for all you suggestion!


Regards,
Norman